# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigtableAdmin.V2.Model.ColumnFamilyStats do
  @moduledoc """
  Approximate statistics related to a single column family within a table. This information may change rapidly, interpreting these values at a point in time may already preset out-of-date information. Everything below is approximate, unless otherwise specified.

  ## Attributes

  *   `averageCellsPerColumn` (*type:* `float()`, *default:* `nil`) - How many cells are present per column qualifier in this column family, averaged over all rows containing any column in the column family. e.g. For column family "family" in a table with 3 rows: * A row with 3 cells in "family:col" and 1 cell in "other:col" (3 cells / 1 column in "family") * A row with 1 cell in "family:col", 7 cells in "family:other_col", and 7 cells in "other:data" (8 cells / 2 columns in "family") * A row with 3 cells in "other:col" (0 columns in "family", "family" not present) would report (3 + 8 + 0)/(1 + 2 + 0) = 3.66 in this field.
  *   `averageColumnsPerRow` (*type:* `float()`, *default:* `nil`) - How many column qualifiers are present in this column family, averaged over all rows in the table. e.g. For column family "family" in a table with 3 rows: * A row with cells in "family:col" and "other:col" (1 column in "family") * A row with cells in "family:col", "family:other_col", and "other:data" (2 columns in "family") * A row with cells in "other:col" (0 columns in "family", "family" not present) would report (1 + 2 + 0)/3 = 1.5 in this field.
  *   `logicalDataBytes` (*type:* `String.t`, *default:* `nil`) - How much space the data in the column family occupies. This is roughly how many bytes would be needed to read the contents of the entire column family (e.g. by streaming all contents out).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :averageCellsPerColumn => float() | nil,
          :averageColumnsPerRow => float() | nil,
          :logicalDataBytes => String.t() | nil
        }

  field(:averageCellsPerColumn)
  field(:averageColumnsPerRow)
  field(:logicalDataBytes)
end

defimpl Poison.Decoder, for: GoogleApi.BigtableAdmin.V2.Model.ColumnFamilyStats do
  def decode(value, options) do
    GoogleApi.BigtableAdmin.V2.Model.ColumnFamilyStats.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigtableAdmin.V2.Model.ColumnFamilyStats do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
